/** 
 *  @file
 *  @brief   梁属性解析类
 *  @author  wanghuan
 *  @date    2024.03.06
 *  @version v1.0
 *  @par Copyright(c):  ShenGong  Simulation corporation
 */

#pragma once
#include <map>
#include "DataStructure/Common/SGNamespace.h"
#include "DataStructure/Common/Out.h"
#include "DataStructure/Common/Id.h"
#include "DataStructure/Input/Material/IsotropicMaterial.h"
#include "DataStructure/Input/Property/PBARData.h"
#include "DBManager/DBServiceFactory.h"
#include "../Common/ElementCalculatorExport.h"

SG_NAMESPACE_OPEN
namespace FEMSolver {
namespace Element {
/** 梁属性解析，通过属性 id 号，查询及计算梁的属性
 * 
 *  副作用：调用 GetMatrial，请务必先调用 GetSectionProperty
 */
class ElementCalculator_DECLSPEC BarSectionParser
{
public:
    void GetSectionProperty (const SG::DBManager::DBServiceFactorySP dbServiceFactory, SG::DataStructure::Common::Id pId, _OUT SG::DataStructure::FEM::PBARData& property);
    void GetMatrial (SG::DataStructure::Common::Id mId, _OUT SG::DataStructure::FEM::IsotropicMaterial& material) const;
private:
    std::map<SG::DataStructure::Common::Id, SG::DataStructure::FEM::PBARData> m_property;
    std::map<SG::DataStructure::Common::Id, SG::DataStructure::FEM::IsotropicMaterial> m_mat;
};

}; // end namespace Element
}; // end namespace FEMSolver
SG_NAMESPACE_CLOSE